FROM showcon-registry-registry.cn-hangzhou.cr.aliyuncs.com/library/centos7-openjdk17.0.1-skywalking:v1.0
ARG SW_AGENT_NAME
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone

ENV SW_AGENT_NAME ${SW_AGENT_NAME}
ENV SW_AGENT_COLLECTOR_BACKEND_SERVICES skywalking-oap:11800
ENV JAVA_OPTS ""
VOLUME /logs
ADD /target/app.jar /app.jar
ENTRYPOINT ["sh","-c", "java ${JAVA_OPTS} -javaagent:/skywalking/agent/skywalking-agent.jar --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -jar /app.jar"]